package ControlLayer;
import ModelLayer.*;
import java.util.ArrayList;

/**
 * Write a description of class PersonCtr here.
 * 
 * @author (your name) 
 * @version (a version number or a date)
 */
public class LoanCtr
{
    private LoanContainer loanContainer;

    public LoanCtr()
    {
        loanContainer = loanContainer.getInstance();
    }

    public void createLoan(String id, String borrowDate, String period, String serialNo, String purchaseDate, String purchasePrice, String name, String title)
    {
        loanContainer.createLoan(id,borrowDate,period,serialNo,purchaseDate,purchasePrice,name,title);
    }

    public void deleteLoan(String id)
    {
        loanContainer.deleteLoan(id);
    }

    public Loan findLoan(String id)
    {
        Loan a = loanContainer.findLoan(id);
        return a;
    }

    public String getId(String id)
    {
        Loan a = loanContainer.findLoan(id);
        return a.getId();
    }
    
    public String getTitle(String id)
    {
        Loan a = loanContainer.findLoan(id);
        return a.getTitle();
    }

    public String getName(String id)
    {
        Loan a = loanContainer.findLoan(id);
        return a.getName();
    }

    public String getBorrowDate(String id)
    {
        Loan a = loanContainer.findLoan(id);
        return a.getBorrowDate();
    }

    public String getReturnDate(String id)
    {
        Loan a = loanContainer.findLoan(id);
        return a.getReturnDate();
    }

    public String getPeriod(String id)
    {
        Loan a = loanContainer.findLoan(id);
        return a.getPeriod();
    }

    public String getState(String id)
    {
        Loan a = loanContainer.findLoan(id);
        return a.getState();
    }

    public ArrayList<Loan> getList()
    {
        return loanContainer.getList();
    }
}